import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects

Window {
    width: 1000
    height: 600
    visible: true
    title: "DelegateChoice 示例"
    color: "#f5f5f5"

    RowLayout {
        anchors.fill: parent
        anchors.margins: 20
        spacing: 20

        // 基本示例
        Rectangle {
            Layout.fillHeight: true
            Layout.preferredWidth: 300
            color: "white"
            radius: 10
            layer.enabled: true
            layer.effect: DropShadow {
                transparentBorder: true
                horizontalOffset: 0
                verticalOffset: 2
                radius: 8.0
                samples: 17
                color: "#20000000"
            }

            ColumnLayout {
                anchors.fill: parent
                anchors.margins: 10
                spacing: 10

                Text {
                    text: "基本用法示例"
                    font.pixelSize: 18
                    font.bold: true
                    Layout.alignment: Qt.AlignHCenter
                }

                BasicDelegateChoice {
                    Layout.fillWidth: true
                    Layout.fillHeight: true
                }
            }
        }

        // 索引示例
        Rectangle {
            Layout.fillHeight: true
            Layout.preferredWidth: 300
            color: "white"
            radius: 10
            layer.enabled: true
            layer.effect: DropShadow {
                transparentBorder: true
                horizontalOffset: 0
                verticalOffset: 2
                radius: 8.0
                samples: 17
                color: "#20000000"
            }

            ColumnLayout {
                anchors.fill: parent
                anchors.margins: 10
                spacing: 10

                Text {
                    text: "索引条件示例"
                    font.pixelSize: 18
                    font.bold: true
                    Layout.alignment: Qt.AlignHCenter
                }

                IndexBasedDelegateChoice {
                    Layout.fillWidth: true
                    Layout.fillHeight: true
                }
            }
        }

        // 复杂示例
        Rectangle {
            Layout.fillHeight: true
            Layout.preferredWidth: 300
            color: "white"
            radius: 10
            layer.enabled: true
            layer.effect: DropShadow {
                transparentBorder: true
                horizontalOffset: 0
                verticalOffset: 2
                radius: 8.0
                samples: 17
                color: "#20000000"
            }

            ColumnLayout {
                anchors.fill: parent
                anchors.margins: 10
                spacing: 10

                Text {
                    text: "多条件组合示例"
                    font.pixelSize: 18
                    font.bold: true
                    Layout.alignment: Qt.AlignHCenter
                }

                ComplexDelegateChoice {
                    Layout.fillWidth: true
                    Layout.fillHeight: true
                }
            }
        }
    }
}
